New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ansible provisionning #217
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall the playbook looks good but missing ansible tags
which is super helpful when running specific tasks.
path: /var/lib/rancher/k3s/server | ||
mode: "{{ p.stat.mode }}" | ||
|
||
#- debug: msg="Node TOKEN {{ token }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using ansible tags
here with ['never', 'k3s-debug-logs']
this will make sure the task is only executed once you ran the playbook with -e k3s-debug-logs=true
.
owner: root | ||
group: root | ||
mode: 755 | ||
when: ( ansible_facts.userspace_architecture == "x86_64" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it can be done by constructing a dictionary of values and combine all these tasks into one:
binary_map = {
"x86_64": "k3s"
"arm_64": "k3s-arm64"
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how to make it work could you pls help me and perhaps make a PR on my repo: https://github.com/itwars/k3s-ansible ?
group: root | ||
mode: 0755 | ||
|
||
- name: Enable and check K3s service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use handler here instead of restarting every time
We already have a simple system like this, why bother with ansible? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi,
My proposal is to add a contrib directory. I've done all Ansible stuff to provision a k3s cluster.
Download task is durty because I can' t get k3s version number, so in case of reprovisionning I remove k3s binary and reload it (need to be fixe in future release : #211 ).
For now I've test it with KVM Debian instances. In few days I'll make it happen for ubuntu and Centos.
I wrote setup process for Alpine Linux in README.
Best regards,
Vincent